import {BasicApi} from "@/common/BasicApi.ts";
import {CarportBo, CarportSearchBo, CarportVo} from "@/dto/Carport/Carport.ts";
import Result from "@/common/Result.ts";
import SelectVo from "@/common/SelectVo.ts";
import PageVo from "@/common/PageVo.ts";
import axiosRequest from "@/config/axios.ts";

export class CarportApi implements BasicApi<CarportVo, CarportBo, CarportSearchBo>{
    async deleted(sb: CarportSearchBo): Promise<Result<CarportVo>> {
        return await axiosRequest.post<CarportSearchBo,Result<CarportVo>>("/carport/deleted",sb);
    }

    async deletedAll(sbList: Array<CarportSearchBo>): Promise<Result<Array<CarportVo>>> {
        return await axiosRequest.post<Array<CarportSearchBo>,Result<Array<CarportVo>>>("/carport/deleted_all",sbList);
    }

    async edit(b: CarportBo): Promise<Result<CarportVo>> {
        return await axiosRequest.post<CarportBo,Result<CarportVo>>("/carport/edit",b);
    }

    async editAll(bList: Array<CarportBo>): Promise<Result<Array<CarportVo>>> {
        return await axiosRequest.post<Array<CarportBo>,Result<Array<CarportVo>>>("/carport/edit_all",bList);
    }

    async get(sb: CarportSearchBo): Promise<Result<CarportVo>> {
        return await axiosRequest.post<CarportSearchBo,Result<CarportVo>>("/carport/get",sb);
    }

    async listAll(sb: CarportSearchBo): Promise<Result<Array<CarportVo>>> {
        return await axiosRequest.post<CarportSearchBo,Result<Array<CarportVo>>>("/carport/list_all",sb);
    }

    async option(): Promise<Result<Array<SelectVo<string, number, CarportVo>>>> {
        return await axiosRequest.post<Object,Result<Array<SelectVo<string, number, CarportVo>>>>("/carport/option");
    }

    async pageAll(sb: CarportSearchBo): Promise<Result<PageVo<CarportVo>>> {
        return await axiosRequest.post<CarportSearchBo,Result<PageVo<CarportVo>>>("/carport/page_all",sb);
    }

    async simulate(b:CarportBo){
        return await  axiosRequest.post<CarportBo,Result<CarportVo>>("/carport/simulate",b)
    }

}